package com.dp.order.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dp.order.dto.ExportOrder;
import com.dp.order.entity.WorkOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author linzizun
 * @version 1.0
 */
@Mapper
public interface WorkOrderMapper extends BaseMapper<WorkOrder> {

    /**
     * 获取所有未导出工单
     * @return 未导出工单列表
     * @param color 颜色
     */
    @Select("SELECT color,tb_customer.id,tb_work_order.account,clothes_rod_length,quantity,pole_number " +
            "FROM tb_work_order JOIN tb_customer ON tb_work_order.account=tb_customer.account " +
            "WHERE tb_work_order.has_delete=0 AND color=#{color} ORDER BY pole_number,clothes_rod_length")
    List<ExportOrder> getExportOrder(String color);
}
